package Collection;

import java.util.Comparator;
import java.util.Map;
import java.util.Scanner;
import java.util.TreeMap;

/**
 * @author wuhan
 * @date 2019/9/28 22:05
 */

public class MapTest2 {
    private static String charCount(String str){
        char[] chars = str.toCharArray();
        StringBuilder stringBuffer=new StringBuilder();
        TreeMap<Character,Integer> tm=new TreeMap<>((Comparator<Character>) Integer::compare);
        for (char aChar : chars) {
            Integer value = tm.get(aChar);
            if (null == value) {
                tm.put(aChar, 1);
            } else {
                value = value + 1;
                tm.put(aChar, value);

            }
        }
        for (Map.Entry<Character, Integer> characterIntegerEntry : tm.entrySet()) {
            stringBuffer.append(characterIntegerEntry).append(" ");
        }
        return stringBuffer.toString();
    }
    public static void main(String[] args) {
//        TreeMap<Character,Integer> tm=new TreeMap<>();
//        for (int i = 97; i < 97+26; i++) {
//            tm.put((char)i,0);
//        }
//        String s="aaaaehqifobwenoivqnpiqwbnvjdsbvkjae";
//        char[] chars = s.toCharArray();
//        for (int i = 0; i < chars.length; i++) {
//            if (tm.containsKey(chars[i])){
//                tm.replace(chars[i],tm.get(chars[i])+1);
//            }
//        }
//
//
//        for (Map.Entry<Character, Integer> characterIntegerEntry : tm.entrySet()) {
//            System.out.println(characterIntegerEntry);
//        }
        Scanner scanner = new Scanner(System.in);
        String next = scanner.next();
        System.out.println(charCount(next));

    }
}
